function (add_oblivious_test file)
  get_filename_component (FILE_NAME ${file} NAME_WE)
  get_filename_component (FILE_EXT ${file} EXT)
  set (TEST_NAME "Oblivious${FILE_NAME}")
  add_executable (${TEST_NAME} ${file})
  configure_exec_test (${TEST_NAME})
  if ("${FILE_EXT}" STREQUAL ".c")
    set (OBLIVIOUS_LIB Oblivious)
  else ()
    set (OBLIVIOUS_LIB ObliviousCXX)
  endif ()
  target_link_libraries (${TEST_NAME} ${OBLIVIOUS_LIB})
  if ((DEFINED ARGV1) AND ("${ARGV1}" STREQUAL "ENABLE_LOGGING"))
    target_compile_definitions (${TEST_NAME} PRIVATE __LOG_LIB_OBLIVIOUS__)
  endif ()
endfunction (add_oblivious_test)

add_oblivious_test(CopyTest.cpp)
add_oblivious_test(SwapTest.cpp)
add_oblivious_test(ReadTest.cpp)
add_oblivious_test(WriteTest.cpp)
add_oblivious_test(CTest.c)
add_oblivious_test(OTest.cpp)
add_oblivious_test(OIteratorTest.cpp)
add_oblivious_test(OInputIteratorTest.cpp)
add_oblivious_test(OOutputIteratorTest.cpp)
add_oblivious_test(OForwardIteratorTest.cpp)
add_oblivious_test(OBidirectionalIteratorTest.cpp)
add_oblivious_test(ORandomAccessIteratorTest.cpp)
add_oblivious_test(ContiguousAllocatorTest.cpp)
add_oblivious_test(PageAllocatorTest.cpp)
add_oblivious_test(AllocatorTest.cpp)
add_oblivious_test(AlgorithmTest.cpp)
add_oblivious_test(VectorTest.cpp ENABLE_LOGGING)
add_oblivious_test(ForwardListTest.cpp ENABLE_LOGGING)
add_oblivious_test(ListTest.cpp ENABLE_LOGGING)
add_oblivious_test(DequeTest.cpp ENABLE_LOGGING)
